package xyz.xiaomeiqiu.study;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Import;
import org.springframework.jdbc.core.JdbcTemplate;
import xyz.xiaomeiqiu.study.config.TransactionConfiguration;
import xyz.xiaomeiqiu.study.service.OrderService;

import javax.annotation.PostConstruct;
import javax.annotation.Resource;

@SpringBootApplication
@Import(TransactionConfiguration.class)
public class App {

    @Resource
    private OrderService orderService;

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }

    @PostConstruct
    public void executeOrderService() {
        orderService.init();
        orderService.selectAll();
        orderService.cleanup();
    }
}